<div id="bloc-tabs">

    <ul>
        <?php if ($show_add_button): ?>
            <div class="_fr">
                <a class="add-bloc" onclick="Blocuri.addBlocuri.show()">adaugă un bloc</a>
            </div>
            <div id="add-blocuri-dialog" title="Adaugă unul sau mai multe blocuri">
                <?php include_component('apartamente', 'emptyBlocuri', array('header' => false, 'add' => true)) ?>
            </div>
        <?php endif; ?>

        <div class="_fl">Bloc:</div>
        <?php foreach ($blocuri as $value) : ?>
            <li>
                <?php $href = $lazy_load ? url_for('apartamente/xBloc?id=' . $value['ID'], true) : '#bloc-' . $value['ID']; ?>
                <a id="bloc-tab-<?php echo $value['ID'] ?>" class="<?php if ($value['INCOMPLETE']) echo 'incomplete' ?>" href="<?php echo $href ?>"><?php echo $value['NAME'] ?></a>
            </li>
        <?php endforeach; ?>
    </ul>

    <?php if (!$lazy_load): ?>
        <div id="bloc-<?php echo $value['ID'] ?>">
            <?php include_component('apartamente', 'blocContent', array('id' => $value['ID'])) ?>
        </div>
    <?php endif; ?>

</div>

<?php if ($show_delete): ?>
    <div id="delete-bloc-dialog" title="">

    </div>
<?php endif; ?>

<script type="text/javascript">
    Blocuri.tabs('bloc-tabs');
    Blocuri.addBlocuri.init('add-blocuri-dialog');
</script>
